using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MessageBoxProject
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        string title = "Huukhang.com";
        string msg = "Welcome to C# 2005";
        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show(msg);
        }

        private void button2_Click(object sender, EventArgs e)
        {

            Form frm = new Form();
            frm.Text = "Testing";
            frm.StartPosition = FormStartPosition.CenterScreen;            
            frm.Show();
            MessageBox.Show(frm, msg);            
        }

        private void button3_Click(object sender, EventArgs e)
        {
            MessageBox.Show(msg, title);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Form frm = new Form();
            frm.Text = "Testing";
            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.Show();
            MessageBox.Show(frm, msg,title);
        }

        private void button5_Click(object sender, EventArgs e)
        {
            MessageBox.Show(msg, title, MessageBoxButtons.RetryCancel);
        }

        private void button6_Click(object sender, EventArgs e)
        {
            Form frm = new Form2();
            frm.Text = "Testing";
            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.Show();
            MessageBox.Show(this, msg, title, MessageBoxButtons.YesNoCancel);
        }

        private void button7_Click(object sender, EventArgs e)
        {
            MessageBox.Show(msg, title, MessageBoxButtons.AbortRetryIgnore,MessageBoxIcon.Warning);
        }

        private void button8_Click(object sender, EventArgs e)
        {
            Form frm = new Form2();
            frm.Text = "Testing";
            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.Show();
            MessageBox.Show(this, msg, title, MessageBoxButtons.YesNoCancel,MessageBoxIcon.Information);
        }

        private void button9_Click(object sender, EventArgs e)
        {
            MessageBox.Show(msg, title, 
                MessageBoxButtons.AbortRetryIgnore, 
                MessageBoxIcon.Warning, 
                MessageBoxDefaultButton.Button3 );
        }

        private void button10_Click(object sender, EventArgs e)
        {
            Form frm = new Form2();
            frm.Text = "Testing";
            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.Show();
            MessageBox.Show(this, msg, title, 
                MessageBoxButtons.YesNoCancel, 
                MessageBoxIcon.Information,
                MessageBoxDefaultButton.Button3);
        }

        private void button11_Click(object sender, EventArgs e)
        {
            MessageBox.Show(msg, title,
                MessageBoxButtons.AbortRetryIgnore,
                MessageBoxIcon.Warning,
                MessageBoxDefaultButton.Button3,
                MessageBoxOptions.RtlReading 
                );
        }

        private void button12_Click(object sender, EventArgs e)
        {
            Form frm = new Form2();
            frm.Text = "Testing";
            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.Show();
            MessageBox.Show(this, msg, title,
                MessageBoxButtons.YesNoCancel,
                MessageBoxIcon.Information,
                MessageBoxDefaultButton.Button3,
                MessageBoxOptions.RtlReading);
        }

        private void button13_Click(object sender, EventArgs e)
        {
            MessageBox.Show(msg, title,
                MessageBoxButtons.YesNoCancel,
                MessageBoxIcon.Warning,
                MessageBoxDefaultButton.Button1,
                MessageBoxOptions.RtlReading, true 
                );
        }

        private void button14_Click(object sender, EventArgs e)
        {
            MessageBox.Show(msg, title,
                MessageBoxButtons.YesNoCancel,
                MessageBoxIcon.Warning,
                MessageBoxDefaultButton.Button1,
                MessageBoxOptions.RtlReading, @"D:\Books\Examples\C#2005\Chapter07\cs.chm"
                );
        }

        private void button15_Click(object sender, EventArgs e)
        {
            Form frm = new Form2();
            frm.Text = "Testing";
            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.Show();
            MessageBox.Show(this, msg, title,
                MessageBoxButtons.YesNoCancel,
                MessageBoxIcon.Information,
                MessageBoxDefaultButton.Button3,
                MessageBoxOptions.RtlReading,
                @"D:\Books\Examples\C#2005\Chapter07\cs.chm");
        }

        private void button16_Click(object sender, EventArgs e)
        {
            Form frm = new Form3();
            frm.ShowDialog();
        }
        //@"http://www.huukhang.com/study.aspx" MessageBox.Show(msg, tile, MessageBoxButtons.OK, MessageBoxIcon.Stop,MessageBoxDefaultButton.Button1,MessageBoxOptions.ServiceNotification);
    }
}